import { actionType } from './index'
import axios from 'axios'
const changeLoginStatus = () => ({
  type: actionType.LOG_IN,
})
export const login = (data) => {
  return (dispatch) => {
    axios.post('https://www.fastmock.site/mock/117dfab41e7433b4719b831059118248/react_jianshu/api/login', {
      data: data
    }).then((response) => {
      dispatch(changeLoginStatus())
    })
  }
}
export const logOut = () => ({
  type: actionType.LOG_OUT,
  value: false
})